Socket
Socket
Sign inDemoInstall

@babel/plugin-syntax-function-bind

Package Overview
Dependencies
Maintainers
4
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-syntax-function-bind

Allow parsing of function bind


Version published
Weekly downloads
167K
increased by6.64%
Maintainers
4
Weekly downloads
 
Created

What is @babel/plugin-syntax-function-bind?

@babel/plugin-syntax-function-bind is a Babel plugin that allows you to use the function bind syntax in your JavaScript code. This syntax is a proposed feature for ECMAScript that allows you to bind a function to a specific context (this value) more succinctly.

What are @babel/plugin-syntax-function-bind's main functionalities?

Function Bind Syntax

This feature allows you to use the `::` operator to bind a function to a specific context. In this example, `obj::getX` binds the `getX` function to the `obj` object, so when `boundGetX` is called, it returns `42`.

const obj = { x: 42 };
const getX = function() { return this.x; };
const boundGetX = obj::getX;
console.log(boundGetX()); // 42

Other packages similar to @babel/plugin-syntax-function-bind

Keywords

FAQs

Package last updated on 26 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc